
FIND_PATH(LibCheck_INCLUDE_DIR check.h
 HINTS /usr/local/include
 HINTS /usr/include
 HINTS ~/libs/include
 HINTS ~/include
 HINTS ${PROJECT_SOURCE_DIR}/external/check-build/src
)

FIND_LIBRARY(LibCheck_LIBRARY NAMES check
 HINTS /usr/local/lib
 HINTS /usr/lib
 HINTS /local/lib
 HINTS ~/libs/lib
 HINTS ${PROJECT_SOURCE_DIR}/external/check-build/src/.libs
)

FIND_LIBRARY(LibCheck_STATIC_LIBRARY "libcheck${CMAKE_STATIC_LIBRARY_SUFFIX}"
 HINTS /usr/local/lib
 HINTS /usr/lib
 HINTS ~/libs/lib
 HINTS ${PROJECT_SOURCE_DIR}/external/check-build/src/.libs
)


if( LibCheck_INCLUDE_DIR )
  if( LibCheck_LIBRARY )
    set( LibCheck_FOUND TRUE )
    set( LibCheck_LIBRARIES ${LibCheck_LIBRARY} )
    set( LibCheck_STATIC_LIBRARY_PATH ${LibCheck_STATIC_LIBRARY} )
  endif( LibCheck_LIBRARY)
endif( LibCheck_INCLUDE_DIR)

if( LibCheck_FOUND )
  if( NOT LibCheck_FIND_QUIETLY )
    MESSAGE(STATUS "Found LibCheck: ${LibCheck_LIBRARIES}" )
    MESSAGE(STATUS "static LibCheck path: ${LibCheck_STATIC_LIBRARY_PATH}" )
  endif( NOT LibCheck_FIND_QUIETLY )
else( LibCheck_FOUND )
  if( LibCheck_FIND_REQUIRED )
    MESSAGE(SEND_ERROR "Could NOT find LibCheck" )
  endif( LibCheck_FIND_REQUIRED )
endif( LibCheck_FOUND )

MARK_AS_ADVANCED( LibCheck_INCLUDE_DIR LibCheck_LIBRARIES )
